<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
        #imag{
            width: 100px;
            height: 100px;
            background:url("img/tx.jpg") no-repeat;
        }
        #image{
            width: 150px;
            height: 100px;
            background:url("img/tx.jpg") no-repeat yellow;
            background-size: cover;
        }
        #image1{
            width: 100px;
            height: 100px;
            background:url("img/tx.jpg") no-repeat;
            background-size:contain;
        }
    </style>
</head>
<body>
    <h3>像素</h3>
    <div id="imag"></div>
    <h3>cover</h3>
    <div id="image"></div>
    <h3>contain</h3>
    <div id="image1"></div>
</body>
</html>